package cn.wolfcode.p2p.business.service;

import cn.wolfcode.p2p.business.domain.Bid;
import cn.wolfcode.p2p.business.domain.BidRequest;
import cn.wolfcode.p2p.business.domain.BidRequestAuditHistory;
import cn.wolfcode.p2p.business.vo.PublishAuditVO;
import com.github.pagehelper.PageInfo;
import cn.wolfcode.base.QueryObject;

import java.util.List;

public interface IBidRequestService {

    /**
     * 多条件过滤和分页查询
     *
     * @param qo 封装查询条件
     * @return
     */
    PageInfo<BidRequest> query(QueryObject qo);

    /**
     * 当前用户的投标信息
     *
     * @param createUserId
     * @return
     */
    BidRequest getByCreateUserId(Long createUserId);

    /**
     * 申请借款
     *
     * @param vo
     */
    void apply(BidRequest vo);

    /**
     * 发标前审核
     *
     * @param vo
     */
    void audit(PublishAuditVO vo);

    /**
     * 发标前审核(时间处理)
     * @param id
     * @param state
     * @param remark
     * @param publishTime 发标时间null立刻发标,否则定时发标
     */
    void publishAudit(Long id, int state, String remark, String publishTime);

    BidRequest get(Long id);

    /**
     * 查询某个借款记录的所有审核历史
     * @param bidRequestId
     * @return
     */
    List<BidRequestAuditHistory> listAuditHistorysByBidRequestId(Long bidRequestId);

    /**
     * 列出指定数量的借款,处于1.投标中,2.还款中,3已完成,依次排序
     * @param number
     * @return
     */
    List<BidRequest> listIndexBidRequests(int number);
}